From e4e175c892a5030b6ee10aeab90bc83719ecdbca Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Wed, 24 Aug 2005 14:48:35 +0000 Subject: [PATCH] use tempfile command to create names of temporary files --- ChangeLog | 6 +++ docs/Makefile.am | 7 ++- docs/index-static.html.in | 97 +++++++++++++++++++++++---------------- docs/tools/xml_insert.sh | 2 +- 4 files changed, 70 insertions(+), 42 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8e37f08..36f8a1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-08-23 Øyvind Kolås + + * docs/Makefile.am: use `tempfile` to create name of temporary file + * docs/tools/xml_insert.sh: use `tempfile` to create name of temporary + file. + 2005-08-23 Øyvind Kolås * babl/babl-classes.c, diff --git a/docs/Makefile.am b/docs/Makefile.am index b083911..0d2d7ac 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -27,8 +27,11 @@ all: $(HTML_FILES) index.html: index-static.html $(top_builddir)/tests/babl_html_dump ../AUTHORS ../NEWS cp $< $@ - $(top_builddir)/tests/babl_html_dump > /tmp/BablBase.html - $(top_srcdir)/docs/tools/xml_insert.sh $@ BablBase /tmp/BablBase.html + (TMPFILE=`tempfile`;\ + $(top_builddir)/tests/babl_html_dump > $$TMPFILE;\ + $(top_srcdir)/docs/tools/xml_insert.sh $@ BablBase $$TMPFILE;\ + rm -f $$TMPFILE ) + $(top_srcdir)/docs/tools/xml_insert.sh $@ AUTHORS $(top_srcdir)/AUTHORS $(top_srcdir)/docs/tools/xml_insert.sh $@ NEWS $(top_srcdir)/NEWS diff --git a/docs/index-static.html.in b/docs/index-static.html.in index 778b781..cac9c0e 100644 --- a/docs/index-static.html.in +++ b/docs/index-static.html.in @@ -38,7 +38,7 @@
  •   Core
  •   Extensions
  • Source
  • -
  • Basic Usage
  • +
  • Usage
  • Extending
  • TODO
  •   Core
  • @@ -68,15 +68,24 @@

    Core

      -
    • Small polymorphic API requiring minimal manual memory management - to specify and convert between linear and planar - buffers as provided for by registered data types and color - models.
    • -
    • Thread safety for processing.
    • -
    • Horizontal an vertical subsampling (for implementing 4:2:2 4:2:0 - 4:1:1 etc. chroma subsampling)
    • -
    • Accurate (hopefully) reference data types and color models implemented using - 64bit floating point. +
    • Small API for simple use cases
    • +
    • Specification of new formats
    • +
    • Planar and linear buffers
    • +
    • Thread safety for processing.
    • + +
    • Extension and introspection of formats, + color models, components and datatypes
    • +
    • Horizontal an vertical subsampling (for + implementing 4:2:2 4:2:0 4:1:1 etc. chroma subsampling)
    • +
    • Reference 64bit floating point conversions for data types and color models. + +

      Note: This portion of babl has still not received rigorous + testing, the main development of babl is still focused on internal + infrastructure work. As the development of babl allows, initial tests + and usage of babl is welcome; as it would help kill of random + mystypes in constants and such earlier, and make it a more valid + actual regression suite. +

    @@ -86,7 +95,7 @@ At compile, load and runtime; babl is extendable with:

      -
    • data types.
    • +
    • data types.
    • color models.
    • pixel formats.
    • optimized conversion functions: @@ -135,46 +144,56 @@ --> - -

      Basic usage

      + +

      Usage

      The simplest scenario for using babl is converting between linear buffers represented by an existing BablPixelFormat.

      -
      -#include <babl.h>
      -
      -unsigned char srgb_buf[WIDTH*HEIGHT*3];
      -float         lab_buf[WIDTH*HEIGHT*3];
      -...
      -
      -babl_init (); /* initialize babl library */
      -
      -...
      -
      -Babl *babl_fish = babl_fish (babl_pixel_format ("srgb"),
      -                             babl_pixel_format ("lab-float"));
      -
      -babl_fish_process (fish, srgb_buf, lab_buf, WIDTH * HEIGHT);
      -
      -...
      +        
      babl_process (babl_fish ("srgb", "lab-float"),
      +              srgb_buffer, lab_buffer,
      +              pixel_count);
      + +

      If the existing pixel formats are not sufficient for your conversion + needs, new ones can be created and named on the fly. The constructor + will provide the prior created one if duplicates are registered.

      +
      babl_format_new ("bgr-u8",
      +                 babl_model ("rgb"),
      +                 babl_type ("u8"),
      +                 babl_component ("B"),
      +                 babl_component ("G"),
      +                 babl_component ("R"),
      +                 NULL);
      + +

      Instead of a linear buffer you can an image descriptor which desribes the start of the memory segment, the pitch in bytes between samples, and the rowstride (optionally 0 for unlimited). +

      +
      babl_process (babl_fish ("srgb", "y'cbcr420p"),
      +              srgb_buffer,
      +              babl_image ("Y'", luma_buffer, 1, 0,
      +                          "Cb", cb_buffer,   1, 0,
      +                          "Cr", cr_buffer,   1, 0,
      +                          NULL);
      +
      -babl_destroy (); /* deinitialize babl library */ -

      For more code samples look in the tests directory.

      Extending

      For samples of how the current internal api of specification of - data types, color models, pixel formats and their conversions look - in the babl/base/ directory. The tables in this HTML file is directly generated - based on the data registered by BablBase. + data types, color models, and conversions look in the babl/base/ + directory. The tables in this HTML file is directly generated + based on the data registered by BablBase. The API's used are very + similar in style to the API's described under the Usage section.

      -

      For now, the only way to extend babl is from the application using the library, - by structuring your code in a similar fashion to BablBase it should be easier - to later turn it into a loadable module. +

      For now, the only way to extend babl is from the application + using the library, by structuring your code in a similar fashion + to BablBase it should be easier to later turn it into a loadable + module.

      @@ -210,7 +229,7 @@ babl_destroy (); /* deinitialize babl library */ NB: the modules will be loaded from the directories pointed to by the path in reverse order, this should allow the user to override - system wide installed types, models and pixel formats. + system wide definitions for types, models and formats.
    diff --git a/docs/tools/xml_insert.sh b/docs/tools/xml_insert.sh index 5614f3a..f53a8c4 100755 --- a/docs/tools/xml_insert.sh +++ b/docs/tools/xml_insert.sh @@ -11,7 +11,7 @@ # # FIXME: add argument checking / error handling -TMP_FILE=index-tmp.html +TMP_FILE=`tempfile` cp $1 $TMP_FILE -- 2.30.2